package com.cityeye.util;

import com.cityeye.dao.DepartmentDao;
import com.cityeye.dao.IssueTypeDao;
import com.cityeye.entity.Department;
import com.cityeye.entity.Issuetype;

public class QryKeys {

	public static final String NEW_ARRIVED_MSG = "NEW_ARRIVED_MSG";
	
	public static final String SUBISSUE_PA_ISSUETYPE = "KEY_SUBISSUE_PA_ISSUETYPE";
	public static final String DEPT_PA_DEPARTMENT = "KEY_DEPT_PA_DEPARTMENT";
	public static final String PATROL_DEPARTMENT = "KEY_PATROL_DEPARTMENT";

//	public static final String MSG_DEPARTMENT = "KEY_MSG_DEPARTMENT";
	public static final String MSG_INBOX_ID = "KEY_MSG_INBOX_ID";	
	public static final String MSG_SENT_ID = "KEY_MSG_SENT_ID";
	public static final String MSG_COMP_ID = "KEY_MSG_COMP_ID";
	public static final String MSG_ARCH_ID = "KEY_MSG_ARCH_ID";	
	public static final String MSG_INBOX_PATROL = "KEY_MSG_INBOX_PATROL";
	public static final String MSG_SENT_PATROL = "KEY_MSG_SENT_PATROL";
	public static final String MSG_COMP_PATROL = "KEY_MSG_COMP_PATROL";
	public static final String MSG_ARCH_PATROL = "KEY_MSG_ARCH_PATROL";
	public static final String MSG_SENT_DEPARTMENT = "KEY_MSG_SENT_DEPARTMENT";
	public static final String MSG_COMP_DEPARTMENT = "KEY_MSG_COMP_DEPARTMENT";
	public static final String MSG_ARCH_DEPARTMENT = "KEY_MSG_ARCH_DEPARTMENT";

	public static final String MSG_QU_INBOX_ID = "KEY_MSG_QU_INBOX_ID";
	public static final String MSG_QU_PATROL = "KEY_MSG_QU_PATROL";
	public static final String MSG_QU_SENT_ID = "KEY_MSG_QU_SENT_ID";
	public static final String MSG_QU_COMP_ID = "KEY_MSG_QU_COMP_ID";
	public static final String MSG_QU_ARCH_ID = "KEY_MSG_QU_ARCH_ID";
	public static final String MSG_QU_INBOX_PATROL = "KEY_MSG_QU_INBOX_PATROL";
	public static final String MSG_QU_SENT_PATROL = "KEY_MSG_QU_SENT_PATROL";
	public static final String MSG_QU_COMP_PATROL = "KEY_MSG_QU_COMP_PATROL";
	public static final String MSG_QU_ARCH_PATROL = "KEY_MSG_QU_ARCH_PATROL";
	public static final String MSG_QU_INBOX_DEPARTMENT = "KEY_MSG_QU_INBOX_DEPARTMENT";
	public static final String MSG_QU_SENT_DEPARTMENT = "KEY_MSG_QU_SENT_DEPARTMENT";
	public static final String MSG_QU_COMP_DEPARTMENT = "KEY_MSG_QU_COMP_DEPARTMENT";
	public static final String MSG_QU_ARCH_DEPARTMENT = "KEY_MSG_QU_ARCH_DEPARTMENT";

	public static final String MSG_JD_INBOX_ID = "KEY_MSG_JD_INBOX_ID";
	public static final String MSG_JD_COMP_ID = "KEY_MSG_JD_COMP_ID";
	public static final String MSG_JD_ARCH_ID = "KEY_MSG_JD_ARCH_ID";	

	public static final String MSG_JD_INBOX_PATROL = "KEY_MSG_JD_INBOX_PATROL";
	public static final String MSG_JD_SENT_PATROL = "KEY_MSG_JD_SENT_PATROL";
	public static final String MSG_JD_COMP_PATROL = "KEY_MSG_JD_COMP_PATROL";
	public static final String MSG_JD_ARCH_PATROL = "KEY_MSG_JD_ARCH_PATROL";
//	public static final String MSG_QU_DEPARTMENT = "KEY_MSG_QU_DEPARTMENT";
//	public static final String MSG_JD_DEPARTMENT = "KEY_MSG_JD_DEPARTMENT";

	
	public static final String QRY_QU_DEPARTMENT = "KEY_QRY_QU_DEPARTMENT";
	public static final String QRY_JD_DEPARTMENT = "KEY_QRY_JD_DEPARTMENT";	
	
	public static final String QRY_ISSUETYPE = "KEY_QRY_ISSUETYPE";
	public static final String QRY_SUBISSUETYPE = "KEY_QRY_SUBISSUETYPE";
	
//	public static final String MSGINBOX_DEPARTMENT = "KEY_MSGINBOX_DEPARTMENT";
//	public static final String MSGSENT_DEPARTMENT = "KEY_MSGSENT_DEPARTMENT";
//	public static final String MSGCOMPLETE_DEPARTMENT = "KEY_MSGCOMPLETE_DEPARTMENT";
//	public static final String MSGARCHIVED_DEPARTMENT = "KEY_MSGARCHIVED_DEPARTMENT";
//
//
//	public static final String QU_MSGINBOX_DEPARTMENT = "KEY_QU_MSGINBOX_DEPARTMENT";
//	public static final String QU_MSGSENT_DEPARTMENT = "KEY_QU_MSGSENT_DEPARTMENT";
//	public static final String QU_MSGCOMPLETE_DEPARTMENT = "KEY_QU_MSGCOMPLETE_DEPARTMENT";
//	public static final String QU_MSGARCHIVED_DEPARTMENT = "KEY_QU_MSGARCHIVED_DEPARTMENT";
//	
//	public static final String JD_MSGINBOX_DEPARTMENT = "KEY_JD_MSGINBOX_DEPARTMENT";
//	public static final String JD_MSGSENT_DEPARTMENT = "KEY_JD_MSGSENT_DEPARTMENT";
//	public static final String JD_MSGCOMPLETE_DEPARTMENT = "KEY_JD_MSGCOMPLETE_DEPARTMENT";
//	public static final String JD_MSGARCHIVED_DEPARTMENT = "KEY_JD_MSGARCHIVED_DEPARTMENT";
	
	
	public static IEntity getQryObject(String key, String id) {	
		if(key.endsWith("_DEPARTMENT")){
			return DepartmentDao.findById(Department.class, Integer.parseInt(id));
		}else if(key.endsWith("_ISSUETYPE")){
			return IssueTypeDao.findById(Issuetype.class, Integer.parseInt(id));			
		}
		return null;
	}

}
